<template>
	<!--@click="addQuery(item.k)"-->
    <div class="search-hotkey">
		<h1 class="hotsearcht">热门搜索</h1>
			<ul>
				<li @click="addQuery(item)" v-for="item of hotlist">
						{{item.name}}
				</li>
			</ul>
	</div>
</template>

<script>
	import api from '../../api/api.js'
	export default {
		data(){
			return{
				hotlist:[]
			}
		},
		methods:{
			addQuery(item){	
				this.$emit('addQuery',item)	
			}
		},
		mounted(){
			var that = this;
			api.home.hotGoods().then((res)=>{
				console.log(res);
				if(res.ret == 200){
			 		this.hotlist = res.data;
			 	}
			});
		}
	}
</script>

<style>
.search-hotkey{margin-top: .3rem;overflow: hidden;}
.hotsearcht{margin-left:.3rem;background: none;height: .5rem;line-height: 0.5rem;font-weight: 100;color: #333;font-size: .25rem;}
 .search-hotkey>ul{background: none;margin: 0 auto; width: 90%;}
 .search-hotkey>ul>li{border-radius:5!important;margin-right:.2rem;margin-bottom:.2rem;padding:.2rem;background: none;display: inline-block;height: .3rem;line-height: 0rem;border: .01rem solid rgba(0,0,0,.6);word-break: keep-all;font-size: .2rem;}
</style>